const {
    default: axios
} = require('axios')

require('../css/commCss/normalize.css')
require('../css/commCss/reset.css')
require('../css/commCss/property.css')
require('../css/commCss/basic.css')
require('../libs/iconfont/iconfont/iconfont.css')

require('../css/couse.less')

document.addEventListener('DOMContentLoaded', function () {
    const title1 = document.querySelectorAll('#title1')
    //console.log(title1);
    const cont1 = document.querySelectorAll('#cont1')
    const image1 = document.querySelectorAll('#image1')
    // const title2=document.querySelectorAll('#title2')
    
    // const title2=document.querySelectorAll('#title2')
    // const cont2=document.querySelectorAll('#cont2')
    axios.get('http://139.9.177.51:8099/sports/allcourse').then(function (res) {
        let data = res.data.data
        //console.log(data[0].name);
        // title1.textContent = data[0].name
        // cont1.textContent = data[0].desc
        // image1.src ='http://139.9.177.51:8099'+data[0].imgurl

        cont1.forEach(function(v,i){

            v.textContent=data[i].desc
        })
        title1.forEach(function(v,i){
            v.textContent=data[i].name
        })
        image1.forEach(function(v,i){
            v.src='http://139.9.177.51:8099'+data[i].imgurl
        })

    })



})